<!-- 医院微站 -->
<template>
	<view class="info-wrapper">
		<!-- <HM-filterDropdown :menuTop="menuTop" :filterData="filterData" :defaultSelected="defaultSelected"
			@confirm="confirm"></HM-filterDropdown> -->
		<view class="top-header">
			<view class="btn" @click="deptlistPickerShow = true">
				<text>科室介绍</text>
			</view>
		</view>
		<view class="banner">
			<image :src="hospitalintro.logo"></image>
		</view>
		<view class="content-wrapper">
			<view class="base-info">
				<p>名称：{{hospitalintro.agentname}}</p>
				<p class="small">电话：{{hospitalintro.hospitaltel}}</p>
				<p class="small">地址：{{hospitalintro.xxaddress}}</p>
				<p class="small">等级：{{hospitalintro.level_name}}</p>
			</view>
			<view class="lntroduction">
				<p>{{hospitalintro.lntroduction}}</p>
			</view>
		</view>
		
		<u-picker :show="deptlistPickerShow" :columns="deptlistPickerColumns" :keyName="'label'" 
		@cancel="deptlistPickerShow = false" @confirm="deptlistPickerConfirm"></u-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				filterData: [{
					"name": '科室介绍',
					"type": 'hierarchy-column',
					"submenu": [
						
					]
				},{
					"name": '科室医生',
					"type": 'hierarchy-column',
					"submenu": [
						
					]
				}],
				hospitalintro: {},
				deptlist: [],
				deptlistPickerShow: false,
				deptlistPickerColumns: [[]]
			}
		},
		onLoad() {
			this.loadHospitalintro()
			this.loadDeptlist()
		},
		methods: {
			loadHospitalintro() {
				this.$app._get('entry/wxapp/regin.hospitalintro', {}, (result)=>{
					this.hospitalintro = result
				})
			},
			loadDeptlist() {
				this.$app._get('entry/wxapp/faxian.deptlist', {}, (result)=>{
					this.deptlist = result
					console.log(this.deptlist)
					this.deptlist[0].submenu.forEach(item => {
						this.deptlistPickerColumns[0].push({
							label: item.name,
							id: item.value
						})
					})
					console.log(this.deptlistPickerColumns)
					// this.filterData[0].submenu = result
				})
			},
			deptlistPickerConfirm(value) {
				let id = value.value[0].id
				uni.navigateTo({
					url: '/pagesB/tabbar/info/deptDetail?id=' + id
				})
			}
		},
		computed: {
			menuTop() {
				/* #ifdef MP-ALIPAY || MP-WEIXIN */
				return "0"
				/* #endif */
				return "84"
			}
		}
	}
</script>

<style scoped lang="scss">
	
	.info-wrapper {
		// padding-top: 40px;
		.top-header {
			width: 100%;
			height: 50px;
			.btn {
				width: 100%;
				height: 100%;
				background-color: #eeeeee;
				text-align: center;
				line-height: 50px;
				float: left;
			}
		}
		.banner {
			width: 100%;
			image {
				width: 100%;
			}
		}
		.content-wrapper {
			box-sizing: border-box;
			padding: 10px;
			.base-info {
				border-radius: 6px;
				border: 1px solid #e3e3e3;
				padding: 10px;
				line-height: 25px;
				background-color: #f5f5f5;
				.small {
					font-size: 0.8rem;
					color: #757575;
				}
				&:first-child {
					font-size: 1.1rem;
				}
			}
			.lntroduction {
				margin-top: 10px;
				border-radius: 6px;
				border: 1px solid #e3e3e3;
				padding: 10px;
				line-height: 25px;
				background-color: #f5f5f5;
				font-size: 0.8rem;
				color: #757575;
				text-align: justify;
			}
		}
	}
	
</style>